#include "stdio.h"
#include "time.h"
#include "unistd.h"
int main(int argc, char const *argv[])
{
    while (1)
    {
    sleep(1); // 1秒钟执行一次循环
    time_t T_1;
    T_1 = time(NULL);
    struct tm * l_time =localtime(&T_1);
    printf("%d-%d-%d ", l_time->tm_year+1900, l_time->tm_mon+1 ,l_time->tm_mday);
    printf("%d:%d:%d\n", l_time->tm_hour, l_time->tm_min ,l_time->tm_sec);
    }
    return 0;
}